<template>
    <div class="sidebar">
        <ul>
            <li>
                <a href="javascript:;">
                    <i class="iconfont icon-sina"></i>
                </a>
            </li>
            <li class="wechat">
                <a href="javascript:;">
                    <i class="iconfont icon-wechat"></i>
                    <div class="qrcode">
                        <img src="/static/images/qrcode.jpg" alt="QRcode">
                        <div class="arrow"></div>
                    </div>
                </a>
            </li>
            <li>
                <a href="javascript:;">
                    <i class="iconfont icon-msg"></i>
                </a>
            </li>
            <li>
                <a href="javascript:;">
                    <i class="iconfont icon-tel"></i>
                </a>
            </li>
        </ul>
    </div>
</template>

<script>
    import VTooltip from 'v-tooltip'
    
    export default {
        name: 'sidebar',
        directives: {
            'tooltip': VTooltip
        },
        data() {
            return {
                abc: 'tesla'
            }
        },
        created() {
        
        }
    }
</script>

<style lang="scss" scoped>
    
    .sidebar {
        position: fixed;
        right: 50px;
        bottom: 10px;
        z-index: 300;
        li {
            position: relative;
            margin-bottom: 5px;
        }
        
        a {
            display: block;
            padding: 10px;
            text-align: center;
        }
        
        .iconfont {
            font-size: 20px;
            color: #444;
        }
        
        .qrcode {
            position: absolute;
            top: 85px;
            left: 0;
            z-index: 300;
            box-sizing: border-box;
            width: 120px;
            height: 120px;
            padding: 2px;
            border: 1px solid #eee;
            background-color: #fff;
            transform-origin: right 54px;
            transform: translate(-100%, -100%) scale(0);
            transition: all .35s;
            img {
                display: block;
                width: 100%;
            }
            .arrow {
                position: absolute;
                box-sizing: border-box;
                top: 46px;
                right: -6px;
                width: 12px;
                height: 12px;
                border-top: 1px solid #eee;
                border-right: 1px solid #eee;
                background-color: #fff;
                transform: rotate(45deg);
            }
        }
        
        .wechat:hover {
            .qrcode {
                transform: translate(-100%, -100%) scale(1);
            }
        }
        
    }
    
</style>
